import 'package:json_annotation/json_annotation.dart';
part 'service_product_list_api.g.dart';

@JsonSerializable()
class ResponseServiceProductListApi {
  @JsonKey(name: 'Entities')
  final List<ServiceProduct> entities;

  factory ResponseServiceProductListApi.fromJson(Map<String, dynamic> json) {
    return _$ResponseServiceProductListApiFromJson(json);
  }

  ResponseServiceProductListApi({required this.entities});

  Map<String, dynamic> toJson() => _$ResponseServiceProductListApiToJson(this);
}

@JsonSerializable()
class ServiceProduct {
  @JsonKey(name: 'new_productgroupidname')
  final String groupIdName;
  @JsonKey(name: 'new_productmodule_idname')
  final String moduleName;
  @JsonKey(name: 'name')
  final String name;
  @JsonKey(name: 'productnumber')
  final String number;
  @JsonKey(name: 'productid')
  final String id;

  factory ServiceProduct.fromJson(Map<String, dynamic> json) {
    return _$ServiceProductFromJson(json);
  }

  ServiceProduct({
    required this.groupIdName,
    required this.moduleName,
    required this.name,
    required this.number,
    required this.id,
  });

  Map<String, dynamic> toJson() => _$ServiceProductToJson(this);
}
